function TbOfficialWechat(params){ 
	 
}

TbOfficialWechat.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new TbOfficialWechat.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new TbOfficialWechat.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new TbOfficialWechat.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.tbowId=function(tbowId){if(this.proxy)return this.getProxy().tbowId(tbowId);  this.put("tbowId", tbowId);return this;};
	/** and tbow_id is null */
	this.tbowIdNull=function(){if(this.proxy)return this.getProxy().tbowIdNull();if(this.get("tbowIdNot")==null)this.put("tbowIdNot", "");this.put("tbowId", null);return this;};
	/** not .... */
	this.tbowIdNot=function(){if(this.proxy)return this.getProxy().tbowIdNot();this.put("tbowIdNot", "not");return this;};
	this.tbowIdNotNull=function(){if(this.proxy)return this.getProxy().tbowIdNotNull();this.put("tbowIdNot", "not");this.put("tbowId", null);return this;};
	this.tbowIdNot=function(tbowId){if(this.proxy)return this.getProxy().tbowIdNot(tbowId);this.put("tbowIdNot", "not");this.put("tbowId", tbowId);return this;};
	/** and tbow_id <= ? */
	this.tbowIdMin=function(min){if(this.proxy)return this.getProxy().tbowIdMin(min);this.put("tbowIdMin", min);return this;};
	/** and tbow_id >= ? */
	this.tbowIdMax=function(max){if(this.proxy)return this.getProxy().tbowIdMax(max);this.put("tbowIdMax", max);return this;};
	this.tbowIdIn=function(ids){
		if(this.proxy)return this.getProxy().tbowIdIn(ids);  this.put("tbowIdIn", ids);return this;
	};	
	
	/** 品牌信息  [Merchant]      **/
	this.tbowBrand=function(tbowBrand){if(this.proxy)return this.getProxy().tbowBrand(tbowBrand);  this.put("tbowBrand", tbowBrand);return this;};
	/** and tbow_brand is null */
	this.tbowBrandNull=function(){if(this.proxy)return this.getProxy().tbowBrandNull();if(this.get("tbowBrandNot")==null)this.put("tbowBrandNot", "");this.put("tbowBrand", null);return this;};
	/** not .... */
	this.tbowBrandNot=function(){if(this.proxy)return this.getProxy().tbowBrandNot();this.put("tbowBrandNot", "not");return this;};
	this.tbowBrandNotNull=function(){if(this.proxy)return this.getProxy().tbowBrandNotNull();this.put("tbowBrandNot", "not");this.put("tbowBrand", null);return this;};
	this.tbowBrandNot=function(tbowBrand){if(this.proxy)return this.getProxy().tbowBrandNot(tbowBrand);this.put("tbowBrandNot", "not");this.put("tbowBrand", tbowBrand);return this;};
	this.tbowBrandIn=function(ids){
		if(this.proxy)return this.getProxy().tbowBrandIn(ids);  this.put("tbowBrandIn", ids);return this;
	};	
	
	/** 二维码图片        **/
	this.tbowQrCode=function(tbowQrCode){if(this.proxy)return this.getProxy().tbowQrCode(tbowQrCode);  this.put("tbowQrCode", tbowQrCode);return this;};
	/** and tbow_qr_code is null */
	this.tbowQrCodeNull=function(){if(this.proxy)return this.getProxy().tbowQrCodeNull();if(this.get("tbowQrCodeNot")==null)this.put("tbowQrCodeNot", "");this.put("tbowQrCode", null);return this;};
	/** not .... */
	this.tbowQrCodeNot=function(){if(this.proxy)return this.getProxy().tbowQrCodeNot();this.put("tbowQrCodeNot", "not");return this;};
	this.tbowQrCodeNotNull=function(){if(this.proxy)return this.getProxy().tbowQrCodeNotNull();this.put("tbowQrCodeNot", "not");this.put("tbowQrCode", null);return this;};
	this.tbowQrCodeNot=function(tbowQrCode){if(this.proxy)return this.getProxy().tbowQrCodeNot(tbowQrCode);this.put("tbowQrCodeNot", "not");this.put("tbowQrCode", tbowQrCode);return this;};
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有官方微信 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/business/officialwechat.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取官方微信分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/business/officialwechat.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取官方微信 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/business/officialwechat.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

TbOfficialWechat.get = function(id){
	var protocol = ux.ajax("/admin/business/officialwechat.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.tbOfficialWechat;
	return null;
}

TbOfficialWechat.where = new TbOfficialWechat.Where(0,true);